package com.heima.model.user.pojos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("ap_user_follow")
@ApiModel(value = "ApUserFollow", description = "app用户关注信息表")
public class ApUserFollow {
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "用户 id")
    @TableField("user_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @ApiModelProperty(value = "关注作者 id")
    @TableField("follow_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long followId;

    @ApiModelProperty(value = "粉丝昵称")
    @TableField("follow_name")
    private String followName;

    @ApiModelProperty(value = "关注度: 0 偶尔感兴趣, 1 一般, 2 经常, 3高度")
    @TableField("level")
    private Short level;

    @ApiModelProperty(value = "是否动态通知")
    @TableField("is_notice")
    private Short noticed;

    @ApiModelProperty(value = "创建时间")
    @TableField("created_time")
    private LocalDateTime createdTime;

    public enum CareLevel {

        SELDOM((short) 0), NORMAL((short) 1), OFTEN((short) 2), ALWAYS((short) 3)
        ;

        private final Short careLevel;

        CareLevel(Short careLevel) {
            this.careLevel = careLevel;
        }

        public Short getCareLevel() {
            return careLevel;
        }
    }
}
